home *** CD-ROM | disk | FTP | other *** search
- From: Mike Brennan <brennan@boeing.com>
- Subject: v02i028: mawk - (Ver. 1.1) An interpreter for the AWK language, Patch02a/4
- Newsgroups: comp.sources.reviewed
- Approved: csr@calvin.dgbt.doc.ca
-
- Submitted-by: Mike Brennan <brennan@boeing.com>
- Posting-number: Volume 2, Issue 28
- Archive-name: mawk/patch02a
- Patch-To: mawk: Volume 1, Issue 50-68
-
- This is patch2 for mawk1.1 which updates mawk1.1.1 to mawk1.1.2
-
- The changes fix all bugs reported since 1.1.1, and add
- new configurations for aix, convex and sysVr4i386.
- See the file PATCHES for more details.
-
-
- Unpack the parts in order.
- To install the patch read the comments in the executable
- /bin/sh script, apply2.sh and then execute it.
-
-
- #!/bin/sh
- # This is a shell archive (produced by shar 3.50)
- # To extract the files from this archive, save it to a file, remove
- # everything above the "!/bin/sh" line above, and type "sh file_name".
- #
- # made 10/09/1992 16:59 UTC by brennan@mlssun12
- # Source directory /usr/brennan/mawk/X
- #
- # existing files will NOT be overwritten unless -c is specified
- #
- # This is part 1 of a multipart archive
- # do not concatenate these parts, unpack them in order with /bin/sh
- #
- # This shar contains:
- # length mode name
- # ------ ---------- ------------------------------------------
- # 822 -rwxr-xr-x apply2.sh
- # 107075 -rw-r--r-- diffs2
- # 91455 -rw-r--r-- Xparse.c
- # 1671 -rw-r--r-- Xparse.h
- # 22396 -rw-r--r-- doc.diff
- #
- if test -r _shar_seq_.tmp; then
- echo 'Must unpack archives in sequence!'
- echo Please unpack part `cat _shar_seq_.tmp` next
- exit 1
- fi
- # ============= apply2.sh ==============
- if test -f 'apply2.sh' -a X"$1" != X"-c"; then
- echo 'x - skipping apply2.sh (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting apply2.sh (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'apply2.sh' &&
- #!/bin/sh
- X
- # apply2.sh
- X
- X
- # move the following files to your mawk directory
- # and execute this script
- #
- #
- # apply2.sh -- this script
- # diffs2
- # Xparse.h
- # Xparse.c
- # doc.diff
- #
- X
- X
- ######## the old parse.[ch] get removed ##########
- # if you want to save them, move them someplace else
- # (there's no good reason to save them)
- X
- rm -f parse.c
- rm -f parse.h
- X
- ########################################
- X
- X
- mv Xparse.h parse.h
- mv Xparse.c parse.c
- X
- X
- echo ignore warnings from mkdir
- patch -s -p1 < diffs2
- X
- X
- ############
- #
- # some users with troff may not have bothered with mawk.doc
- # so don't patch it if we cannot find it
- #
- X
- (
- X cd man
- X
- X if test -f mawk.doc
- X then
- X patch -s < ../doc.diff
- X
- X else
- X echo 'cannot find "mawk.doc"'
- X echo You do not need it if you can format mawk.1
- X
- X fi
- X
- )
- SHAR_EOF
- chmod 0755 apply2.sh ||
- echo 'restore of apply2.sh failed'
- Wc_c="`wc -c < 'apply2.sh'`"
- test 822 -eq "$Wc_c" ||
- echo 'apply2.sh: original size 822, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= diffs2 ==============
- if test -f 'diffs2' -a X"$1" != X"-c"; then
- echo 'x - skipping diffs2 (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting diffs2 (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'diffs2' &&
- *** mawk/ACKNOWLEDGMENT Tue Mar 3 17:28:56 1992
- --- mawk112/ACKNOWLEDGMENT Wed Aug 26 20:47:27 1992
- ***************
- *** 18,21 ****
- --- 18,22 ----
- X Mike Carlton Next 2.1
- X Elliot Jaffe AIX 3.1
- + Jeremy Martin Convex 9.1
- X
- X The DOS version is a lot better thanks to suggestions and testing
- ***************
- *** 26,28 ****
- X explained some of the "dark corners".
- X
- !
- --- 27,30 ----
- X explained some of the "dark corners".
- X
- ! Thank you to everyone who reported bugs or offered encouragement,
- ! suggestions or criticism. (At least the bugs got fixed).
- *** mawk/Makefile.in Tue Mar 3 17:29:04 1992
- --- mawk112/Makefile.in Thu Jun 11 13:33:58 1992
- ***************
- *** 44,48 ****
- X #AWK= mawk # or gawk or nawk or awk
- X #FIX_YTAB=$(AWK) -f modbison.awk
- ! # uncomment this with bison 1.14
- X # don't use an earlier version
- X
- --- 44,48 ----
- X #AWK= mawk # or gawk or nawk or awk
- X #FIX_YTAB=$(AWK) -f modbison.awk
- ! # uncomment this with bison 1.14 or 1.18
- X # don't use an earlier version
- X
- *** mawk/NEW Tue Mar 3 17:22:54 1992
- --- mawk112/NEW Wed Jul 8 09:04:54 1992
- ***************
- *** 57,78 ****
- X
- X
- - length is no longer valid must be length() or length(expr)
- -
- - (programs that fail can be run through
- - examples/ct_length.awk,
- - ct stands for cold turkey)
- -
- - [WARNING: THIS BREAKS SOME OLD AWK SCRIPTS.
- - Mawk1.1 does not support length without arguments, because
- -
- - (1) It's not in the posix draft.
- - (2) It's not in the AWK book.
- - (3) It's inconsistent with the overall language design.
- -
- - Those who disagree with this decision enough to complain should
- - put "pointy-headed purist" somewhere in their Subject: line.
- - ]
- -
- -
- X printf and sprintf are ANSI C compatible, you can for example
- X
- --- 57,60 ----
- *** mawk/PATCHES Tue Mar 3 17:28:54 1992
- --- mawk112/PATCHES Wed Aug 26 21:03:08 1992
- ***************
- *** 1,5 ****
- X
- X
- ! patch1: mawk1.1 to mawk1.1.1
- X
- X 1) fixed bug which caused
- --- 1,65 ----
- X
- + patch2: mawk1.1.1 -> mawk1.1.2 26 Aug 92
- X
- ! 1) Comparisons are done as described the AWK book, which is the
- ! same as mawk1.0. Evidently I lack the requisite mental facilities
- ! to understand posix comparisons , i.e.
- !
- ! echo 0 | mawk '$0 == "0000" { print "true" }'
- ! true
- !
- ! was a major bozo.
- !
- ! 2) If n = split(s, X, r) , then all elements other than
- ! X[1..n] are now deleted from X. This behavior is
- ! consistent with other awks.
- !
- ! 3) foo = "foo"
- ! foo++ evaluates to 0 and value of foo is 1
- !
- ! old behavior was foo++ was "foo" and foo then set to 1
- !
- ! 4) Fixed two bugs in regular expression lexical scanner:
- !
- ! [c1-c2] did not work right if c2 was an escaped character.
- !
- ! function do_str() which collected runs of characters did
- ! not work right if the last character was escaped and the run
- ! ended with * + or ?.
- !
- ! 5) You can now read and write to the same file. E.g.
- !
- ! printf "Enter: " > "/dev/tty"
- ! getline answer < "/dev/tty"
- !
- ! 6) Output to files which are ttys is now unbuffered.
- !
- ! 7) FILENAME and FNR retain their value from the last record in
- ! the END section.
- !
- ! 8) man pages might groff.
- !
- ! 9) New configuration files
- ! aix.h convex.h sysVr4i386.h
- !
- ! 10) Better error recovery for bungled function definitions
- ! via new productions
- !
- ! program_block : outside_error block ;
- ! error : outside_error ;
- !
- ! 11) If i > NF , then ++$i , $i++, g?sub(r,s,$i), now work
- ! correctly.
- !
- ! 12) MsDOS, interactive input: terminating a line with ^Z
- ! works correctly (at least with TC++ compiler).
- !
- ! l3) string_buff had too many users which induced an error in
- ! sprintf(). After parsing, string_buff is now only be used
- ! by sprintf().
- ! (Old fart seduced by subliminal common block).
- !
- ! --------------------------------------------------
- ! patch1: mawk1.1 to mawk1.1.1 (mar 92)
- X
- X 1) fixed bug which caused
- *** mawk/UCONFIG Tue Mar 3 17:28:58 1992
- --- mawk112/UCONFIG Wed Aug 26 20:35:14 1992
- ***************
- *** 24,27 ****
- --- 24,28 ----
- X sysVsco gcc
- X sysV_ieeefp
- + sysVr4i386 gcc rcc
- X xenix_r2
- X stardentVr3
- ***************
- *** 33,36 ****
- --- 34,38 ----
- X sgi
- X aix
- + convex
- X
- X atarist cross compile with gcc
- ***************
- *** 90,93 ****
- --- 92,97 ----
- X math libraries support the IEEE754 standard )
- X
- + sysVr4i386
- + Tested on ESIX and Consensys.
- X
- X stardentVr3
- *** mawk/array.c Tue Mar 3 17:23:04 1992
- --- mawk112/array.c Fri Aug 14 13:07:29 1992
- ***************
- *** 2,6 ****
- X /********************************************
- X array.c
- ! copyright 1991, Michael D. Brennan
- X
- X This is a source file for mawk, an implementation of
- --- 2,6 ----
- X /********************************************
- X array.c
- ! copyright 1991, 1992. Michael D. Brennan
- X
- X This is a source file for mawk, an implementation of
- ***************
- *** 11,15 ****
- X ********************************************/
- X
- ! /* $Log: array.c,v $
- X * Revision 5.1 91/12/05 07:55:32 brennan
- X * 1.1 pre-release
- --- 11,21 ----
- X ********************************************/
- X
- ! /* $Log: array.c,v $
- ! * Revision 5.2 1992/04/07 17:17:31 brennan
- ! * patch 2
- ! * n = split(s,A,r)
- ! * delete A[i] if i not in 1..n
- ! * This is consistent with [ng]?awk
- ! *
- X * Revision 5.1 91/12/05 07:55:32 brennan
- X * 1.1 pre-release
- ***************
- *** 31,34 ****
- --- 37,41 ----
- X static ANODE *PROTO(find_by_dval, (ARRAY, double, int)) ;
- X static void PROTO(load_array_ov, (ARRAY) ) ;
- + static void PROTO(ilist_delete, (ARRAY, ANODE*)) ;
- X
- X
- ***************
- *** 60,74 ****
- X ANODE *q = 0 ; /* holds first deleted ANODE */
- X
- ! while ( p )
- ! {
- X if ( p->sval )
- ! { if ( strcmp(s,p->sval->str) == 0 ) return p ; }
- ! else /* its deleted, mark with q */
- ! if ( ! q ) q = p ;
- X
- ! p = p->link ;
- ! }
- !
- ! /* not there */
- X if ( cflag )
- X {
- --- 67,83 ----
- X ANODE *q = 0 ; /* holds first deleted ANODE */
- X
- ! while ( 1 )
- ! if ( !p ) goto not_there ;
- ! else
- X if ( p->sval )
- ! if ( strcmp(s,p->sval->str) == 0 ) return p ;
- ! else p = p->link ;
- ! else { q = p ; p = p->link ; break ; }
- !
- ! while ( p ) /* q is now set */
- ! if ( p->sval && strcmp(s,p->sval->str) == 0 ) return p ;
- ! else p = p->link ;
- X
- ! not_there :
- X if ( cflag )
- X {
- ***************
- *** 203,213 ****
- X default :
- X ap = find_by_sval(A, string(cp), NO_CREATE) ;
- ! if ( ap && ap->ival >= 0 )
- ! {
- ! int index = ap->ival % A_HASH_PRIME ;
- !
- ! ap = find_by_index(A, index, ap->ival, NO_CREATE) ;
- ! A[index].ilink = ap->ilink ;
- ! }
- X break ;
- X }
- --- 212,216 ----
- X default :
- X ap = find_by_sval(A, string(cp), NO_CREATE) ;
- ! if ( ap && ap->ival >= 0 ) ilist_delete(A, ap) ;
- X break ;
- X }
- ***************
- *** 252,256 ****
- --- 255,276 ----
- X }
- X
- + /* delete an ANODE from the ilist that is known
- + to be there */
- X
- + static void ilist_delete(A, d)
- + ARRAY A ;
- + ANODE *d ;
- + {
- + int index = d->ival % A_HASH_PRIME ;
- + register ANODE *p = A[index].ilink ;
- + register ANODE *q = (ANODE *) 0 ;
- +
- + while ( p != d ) { q = p ; p = p->ilink ; }
- +
- + if ( q ) q->ilink = p->ilink ;
- + else A[index].ilink = p->ilink ;
- + }
- +
- +
- X /* this is called by bi_split()
- X to load strings into an array
- ***************
- *** 264,267 ****
- --- 284,309 ----
- X register int index ;
- X
- + { /* clear A , leaving only A[1]..A[cnt] (if exist) */
- + int i ;
- + ANODE *p ;
- +
- + for( i = 0 ; i < A_HASH_PRIME ; i++ )
- + {
- + p = A[i].link ;
- + while ( p )
- + {
- + if ( p->sval && (p->ival <= 0 || p->ival > cnt) )
- + {
- + if (p->ival >= 0) ilist_delete(A, p) ;
- +
- + free_STRING(p->sval) ;
- + p->sval = (STRING *) 0 ;
- + cell_destroy(p->cp) ;
- + ZFREE(p->cp) ;
- + }
- + p = p->link ;
- + }
- + }
- + }
- X if ( cnt > MAX_SPLIT )
- X {
- *** mawk/bi_funct.c Tue Mar 3 17:23:06 1992
- --- mawk112/bi_funct.c Wed Jul 8 08:40:18 1992
- ***************
- *** 11,18 ****
- X ********************************************/
- X
- ! /* $Log: bi_funct.c,v $
- ! * Revision 5.1 91/12/05 07:55:35 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 11,21 ----
- X ********************************************/
- X
- ! /* $Log: bi_funct.c,v $
- ! * Revision 5.2 1992/07/08 15:43:41 brennan
- ! * patch2: length returns. I am a wimp
- ! *
- ! * Revision 5.1 1991/12/05 07:55:35 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- ***************
- *** 39,45 ****
- X BI_REC bi_funct[] = { /* info to load builtins */
- X
- X "index" , bi_index , 2, 2 ,
- X "substr" , bi_substr, 2, 3,
- - "length" , bi_length, 0, 1,
- X "sprintf" , bi_sprintf, 1, 255,
- X "sin", bi_sin , 1, 1 ,
- --- 42,48 ----
- X BI_REC bi_funct[] = { /* info to load builtins */
- X
- + "length" , bi_length, 0, 1, /* special must come first */
- X "index" , bi_index , 2, 2 ,
- X "substr" , bi_substr, 2, 3,
- X "sprintf" , bi_sprintf, 1, 255,
- X "sin", bi_sin , 1, 1 ,
- ***************
- *** 60,73 ****
- X
- X
- !
- X void bi_funct_init()
- ! { register BI_REC *p = bi_funct ;
- X register SYMTAB *stp ;
- X
- ! while ( p->name )
- X { stp = insert( p->name ) ;
- X stp->type = ST_BUILTIN ;
- ! stp->stval.bip = p++ ;
- X }
- X /* seed rand() off the clock */
- X { CELL c ;
- --- 63,82 ----
- X
- X
- ! /* load built-in functions in symbol table */
- X void bi_funct_init()
- ! { register BI_REC *p ;
- X register SYMTAB *stp ;
- X
- ! /* length is special (posix bozo) */
- ! stp = insert(bi_funct->name) ;
- ! stp->type = ST_LENGTH ;
- ! stp->stval.bip = bi_funct ;
- !
- ! for( p = bi_funct + 1 ; p->name ; p++ )
- X { stp = insert( p->name ) ;
- X stp->type = ST_BUILTIN ;
- ! stp->stval.bip = p ;
- X }
- +
- X /* seed rand() off the clock */
- X { CELL c ;
- *** mawk/bi_funct.h Tue Mar 3 17:23:06 1992
- --- mawk112/bi_funct.h Tue Apr 7 12:56:06 1992
- ***************
- *** 12,19 ****
- X
- X
- ! /* $Log: bi_funct.h,v $
- ! * Revision 5.1 91/12/05 07:59:03 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 12,19 ----
- X
- X
- ! /* $Log: bi_funct.h,v $
- ! * Revision 5.1 1991/12/05 07:59:03 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/bi_vars.c Tue Mar 3 17:23:08 1992
- --- mawk112/bi_vars.c Fri Jul 10 09:17:33 1992
- ***************
- *** 11,18 ****
- X ********************************************/
- X
- ! /* $Log: bi_vars.c,v $
- ! * Revision 5.1 91/12/05 07:55:38 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 11,21 ----
- X ********************************************/
- X
- ! /* $Log: bi_vars.c,v $
- ! * Revision 5.2 1992/07/10 16:17:10 brennan
- ! * MsDOS: remove NO_BINMODE macro
- ! *
- ! * Revision 5.1 1991/12/05 07:55:38 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- ***************
- *** 42,46 ****
- X "RSTART" ,
- X "SUBSEP"
- ! #if MSDOS && NO_BINMODE==0
- X , "BINMODE"
- X #endif
- --- 45,49 ----
- X "RSTART" ,
- X "SUBSEP"
- ! #if MSDOS
- X , "BINMODE"
- X #endif
- ***************
- *** 81,85 ****
- X /* dval is already 0.0 */
- X
- ! #if MSDOS && NO_BINMODE==0
- X BINMODE->type = C_DOUBLE ;
- X #endif
- --- 84,88 ----
- X /* dval is already 0.0 */
- X
- ! #if MSDOS
- X BINMODE->type = C_DOUBLE ;
- X #endif
- *** mawk/bi_vars.h Tue Mar 3 17:23:08 1992
- --- mawk112/bi_vars.h Fri Jul 10 09:17:35 1992
- ***************
- *** 12,19 ****
- X
- X
- ! /* $Log: bi_vars.h,v $
- ! * Revision 5.1 91/12/05 07:59:05 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 12,22 ----
- X
- X
- ! /* $Log: bi_vars.h,v $
- ! * Revision 5.2 1992/07/10 16:17:10 brennan
- ! * MsDOS: remove NO_BINMODE macro
- ! *
- ! * Revision 5.1 1991/12/05 07:59:05 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- ***************
- *** 41,45 ****
- X #define SUBSEP (bi_vars+8)
- X
- ! #if MSDOS && NO_BINMODE==0
- X #define BINMODE (bi_vars+9)
- X #define NUM_BI_VAR 10
- --- 44,48 ----
- X #define SUBSEP (bi_vars+8)
- X
- ! #if MSDOS
- X #define BINMODE (bi_vars+9)
- X #define NUM_BI_VAR 10
- *** mawk/build_mawk Tue Mar 3 17:29:00 1992
- --- mawk112/build_mawk Wed Jul 8 09:37:46 1992
- ***************
- *** 86,89 ****
- --- 86,92 ----
- X config=sysV_ieeefp.h ;;
- X
- + sysVr4i386)
- + config=sysVr4i386.h ;;
- +
- X # SCO UNIX has ranlib, but doesn't use it for native UNIX libraries
- X sysVsco)
- ***************
- *** 116,122 ****
- X
- X aix)
- ! config=generic.h ;;
- X
- X
- X MF) ;;
- X
- --- 119,129 ----
- X
- X aix)
- ! config=aix.h ;;
- X
- + convex)
- + config=convex.h
- + cflags='-O2 -std' ;;
- X
- +
- X MF) ;;
- X
- ***************
- *** 135,139 ****
- X if gcc -v 2>&1 | egrep 'version 2' >/dev/null
- X then cflags=-O2
- ! else cflags=-O
- X fi
- X fi
- --- 142,146 ----
- X if gcc -v 2>&1 | egrep 'version 2' >/dev/null
- X then cflags=-O2
- ! else cflags='-O -traditional'
- X fi
- X fi
- ***************
- *** 152,164 ****
- X ) > Makefile
- X
- - [ $config = MF ] && exit 0
- X
- X rm -f config.h
- X echo linking config/$config to config.h
- X ln config/$config config.h
- X
- - # make sure parse.c is not made if it exists
- - # it should exist
- - [ -f parse.c ] && { echo touching parse.c ; touch parse.c ; }
- X
- X echo 'ready to run: make -f Makefile'
- --- 159,177 ----
- X ) > Makefile
- X
- X
- + # make sure distribution parse.c is newer than parse.y
- + if [ -f parse.c ] # should be true
- + then
- + echo touching parse.c ; touch parse.c
- + fi
- X rm -f config.h
- +
- +
- + [ $arg1 = MF ] && exit 0
- +
- +
- X echo linking config/$config to config.h
- X ln config/$config config.h
- X
- X
- X echo 'ready to run: make -f Makefile'
- *** mawk/cast.c Tue Mar 3 17:23:10 1992
- --- mawk112/cast.c Mon Aug 17 07:15:58 1992
- ***************
- *** 12,19 ****
- X
- X
- ! /* $Log: cast.c,v $
- ! * Revision 5.1 91/12/05 07:55:41 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 12,22 ----
- X
- X
- ! /* $Log: cast.c,v $
- ! * Revision 5.2 1992/08/17 14:19:45 brennan
- ! * patch2: After parsing, only bi_sprintf() uses string_buff.
- ! *
- ! * Revision 5.1 1991/12/05 07:55:41 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- ***************
- *** 129,133 ****
- X void cast1_to_s( cp )
- X register CELL *cp ;
- ! { register int ival ;
- X
- X switch( cp->type )
- --- 132,138 ----
- X void cast1_to_s( cp )
- X register CELL *cp ;
- ! {
- ! register int ival ;
- ! char xbuff[260] ;
- X
- X switch( cp->type )
- ***************
- *** 140,149 ****
- X
- X if ( (double) (ival = (int) cp->dval) == cp->dval )
- ! (void) sprintf(string_buff, "%d", ival) ;
- X else
- ! (void) sprintf(string_buff ,
- ! string(CONVFMT)->str, cp->dval) ;
- X
- ! cp->ptr = (PTR) new_STRING(string_buff) ;
- X break ;
- X
- --- 145,153 ----
- X
- X if ( (double) (ival = (int) cp->dval) == cp->dval )
- ! (void) sprintf(xbuff, "%d", ival) ;
- X else
- ! (void) sprintf(xbuff , string(CONVFMT)->str, cp->dval) ;
- X
- ! cp->ptr = (PTR) new_STRING(xbuff) ;
- X break ;
- X
- ***************
- *** 160,164 ****
- X void cast2_to_s( cp )
- X register CELL *cp ;
- ! { register int ival ;
- X
- X switch( cp->type )
- --- 164,170 ----
- X void cast2_to_s( cp )
- X register CELL *cp ;
- ! {
- ! register int ival ;
- ! char xbuff[260] ;
- X
- X switch( cp->type )
- ***************
- *** 170,179 ****
- X case C_DOUBLE :
- X if ( (double) (ival = (int) cp->dval) == cp->dval )
- ! (void) sprintf(string_buff, "%d", ival) ;
- X else
- ! (void) sprintf(string_buff ,
- ! string(CONVFMT)->str, cp->dval) ;
- X
- ! cp->ptr = (PTR) new_STRING(string_buff) ;
- X break ;
- X
- --- 176,184 ----
- X case C_DOUBLE :
- X if ( (double) (ival = (int) cp->dval) == cp->dval )
- ! (void) sprintf(xbuff, "%d", ival) ;
- X else
- ! (void) sprintf(xbuff , string(CONVFMT)->str, cp->dval) ;
- X
- ! cp->ptr = (PTR) new_STRING(xbuff) ;
- X break ;
- X
- ***************
- *** 198,207 ****
- X case C_DOUBLE :
- X if ( (double) (ival = (int) cp->dval) == cp->dval )
- ! (void) sprintf(string_buff, "%d", ival) ;
- X else
- ! (void) sprintf(string_buff ,
- ! string(CONVFMT)->str, cp->dval) ;
- X
- ! cp->ptr = (PTR) new_STRING(string_buff) ;
- X break ;
- X
- --- 203,211 ----
- X case C_DOUBLE :
- X if ( (double) (ival = (int) cp->dval) == cp->dval )
- ! (void) sprintf(xbuff, "%d", ival) ;
- X else
- ! (void) sprintf(xbuff , string(CONVFMT)->str, cp->dval) ;
- X
- ! cp->ptr = (PTR) new_STRING(xbuff) ;
- X break ;
- X
- *** mawk/code.c Tue Mar 3 17:23:10 1992
- --- mawk112/code.c Tue Apr 7 12:56:09 1992
- ***************
- *** 12,19 ****
- X
- X
- ! /* $Log: code.c,v $
- ! * Revision 5.1 91/12/05 07:55:43 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 12,19 ----
- X
- X
- ! /* $Log: code.c,v $
- ! * Revision 5.1 1991/12/05 07:55:43 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/code.h Tue Mar 3 17:23:12 1992
- --- mawk112/code.h Tue Apr 7 12:56:10 1992
- ***************
- *** 12,19 ****
- X
- X
- ! /* $Log: code.h,v $
- ! * Revision 5.1 91/12/05 07:59:07 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 12,19 ----
- X
- X
- ! /* $Log: code.h,v $
- ! * Revision 5.1 1991/12/05 07:59:07 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/da.c Tue Mar 3 17:23:12 1992
- --- mawk112/da.c Sat Jul 25 14:32:18 1992
- ***************
- *** 12,19 ****
- X
- X
- ! /* $Log: da.c,v $
- ! * Revision 5.1 91/12/05 07:55:45 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 12,23 ----
- X
- X
- ! /* $Log: da.c,v $
- ! * Revision 5.2 1992/07/25 21:35:25 brennan
- ! * patch2
- ! * fixed small typo on da of _PRE_DEC
- ! *
- ! * Revision 5.1 1991/12/05 07:55:45 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- ***************
- *** 77,85 ****
- X _POST_DEC, "post_dec",
- X _PRE_INC, "pre_inc",
- ! _PRE_INC, "pre_dec",
- X F_POST_INC, "f_post_inc",
- X F_POST_DEC, "f_post_dec",
- X F_PRE_INC, "f_pre_inc",
- ! F_PRE_INC, "f_pre_dec",
- X _EQ, "eq",
- X _NEQ, "neq",
- --- 81,89 ----
- X _POST_DEC, "post_dec",
- X _PRE_INC, "pre_inc",
- ! _PRE_DEC, "pre_dec",
- X F_POST_INC, "f_post_inc",
- X F_POST_DEC, "f_post_dec",
- X F_PRE_INC, "f_pre_inc",
- ! F_PRE_DEC, "f_pre_dec",
- X _EQ, "eq",
- X _NEQ, "neq",
- *** mawk/error.c Tue Mar 3 17:23:14 1992
- --- mawk112/error.c Tue Apr 7 12:56:12 1992
- ***************
- *** 12,19 ****
- X
- X
- ! /* $Log: error.c,v $
- ! * Revision 5.1 91/12/05 07:55:48 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 12,19 ----
- X
- X
- ! /* $Log: error.c,v $
- ! * Revision 5.1 1991/12/05 07:55:48 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/execute.c Tue Mar 3 17:23:16 1992
- --- mawk112/execute.c Tue Aug 11 08:23:00 1992
- ***************
- *** 11,18 ****
- X ********************************************/
- X
- ! /* $Log: execute.c,v $
- ! * Revision 5.1 91/12/05 07:55:50 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 11,36 ----
- X ********************************************/
- X
- ! /* $Log: execute.c,v $
- ! * Revision 5.5 1992/08/11 15:24:55 brennan
- ! * patch2: F_PUSHA and FE_PUSHA
- ! * If this is preparation for g?sub(r,s,$expr) or (++|--) on $expr,
- ! * then if expr > NF, make sure $expr is set to ""
- ! *
- ! * Revision 5.4 1992/08/11 14:51:54 brennan
- ! * patch2: $expr++ is numeric even if $expr is string.
- ! * I forgot to do this earlier when handling x++ case.
- ! *
- ! * Revision 5.3 1992/07/08 17:03:30 brennan
- ! * patch 2
- ! * revert to version 1.0 comparisons, i.e.
- ! * page 44-45 of AWK book
- ! *
- ! * Revision 5.2 1992/04/20 21:40:40 brennan
- ! * patch 2
- ! * x++ is numeric, even if x is string
- ! *
- ! * Revision 5.1 1991/12/05 07:55:50 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- ***************
- *** 138,142 ****
- X
- X case F_PUSHA :
- ! if ( (CELL*)cdp->ptr != field && nf < 0 ) split_field0() ;
- X /* fall thru */
- X
- --- 156,185 ----
- X
- X case F_PUSHA :
- ! cp = (CELL*)cdp->ptr ;
- ! if ( cp != field )
- ! {
- ! if ( nf < 0 ) split_field0() ;
- !
- ! if ( ! (
- ! #if LM_DOS
- ! SAMESEG(cp,field) &&
- ! #endif
- ! cp >= NF && cp <= LAST_PFIELD ) )
- ! {
- ! /* its a real field $1, $2 ...
- ! If its greater than $NF, we have to
- ! make sure its set to "" so that
- ! (++|--) and g?sub() work right
- ! */
- ! t = field_addr_to_index(cp) ;
- ! if ( t > nf )
- ! {
- ! cell_destroy(cp) ;
- ! cp->type = C_STRING ;
- ! cp->ptr = (PTR) &null_str ;
- ! null_str.ref_cnt++ ;
- ! }
- ! }
- ! }
- X /* fall thru */
- X
- ***************
- *** 197,200 ****
- --- 240,252 ----
- X if ( t && nf < 0 ) split_field0() ;
- X sp->ptr = (PTR) field_ptr(t) ;
- + if ( t > nf )
- + {
- + /* make sure its set to "" */
- + cp = sp->ptr ;
- + cell_destroy(cp) ;
- + cp->type = C_STRING ;
- + cp->ptr = (PTR) &null_str ;
- + null_str.ref_cnt++ ;
- + }
- X break ;
- X
- ***************
- *** 671,676 ****
- X
- X case _POST_INC :
- ! (void) cellcpy(sp, cp = (CELL *)sp->ptr) ;
- X if ( cp->type != C_DOUBLE ) cast1_to_d(cp) ;
- X cp->dval += 1.0 ;
- X break ;
- --- 723,730 ----
- X
- X case _POST_INC :
- ! cp = (CELL *)sp->ptr ;
- X if ( cp->type != C_DOUBLE ) cast1_to_d(cp) ;
- + sp->type = C_DOUBLE ;
- + sp->dval = cp->dval ;
- X cp->dval += 1.0 ;
- X break ;
- ***************
- *** 677,682 ****
- X
- X case _POST_DEC :
- ! (void) cellcpy(sp, cp = (CELL *)sp->ptr) ;
- X if ( cp->type != C_DOUBLE ) cast1_to_d(cp) ;
- X cp->dval -= 1.0 ;
- X break ;
- --- 731,738 ----
- X
- X case _POST_DEC :
- ! cp = (CELL *)sp->ptr ;
- X if ( cp->type != C_DOUBLE ) cast1_to_d(cp) ;
- + sp->type = C_DOUBLE ;
- + sp->dval = cp->dval ;
- X cp->dval -= 1.0 ;
- X break ;
- ***************
- *** 699,705 ****
- X case F_POST_INC :
- X cp = (CELL *) sp->ptr ;
- ! (void) cellcpy(sp, cellcpy(&tc, cp) ) ;
- ! cast1_to_d(&tc) ;
- ! tc.dval += 1.0 ;
- X field_assign(cp, &tc) ;
- X break ;
- --- 755,763 ----
- X case F_POST_INC :
- X cp = (CELL *) sp->ptr ;
- ! (void) cellcpy(&tc, cp) ;
- ! cast1_to_d(&tc) ;
- ! sp->type = C_DOUBLE ;
- ! sp->dval = tc.dval ;
- ! tc.dval += 1.0 ;
- X field_assign(cp, &tc) ;
- X break ;
- ***************
- *** 707,713 ****
- X case F_POST_DEC :
- X cp = (CELL *) sp->ptr ;
- ! (void) cellcpy(sp, cellcpy(&tc, cp) ) ;
- ! cast1_to_d(&tc) ;
- ! tc.dval -= 1.0 ;
- X field_assign(cp, &tc) ;
- X break ;
- --- 765,773 ----
- X case F_POST_DEC :
- X cp = (CELL *) sp->ptr ;
- ! (void) cellcpy(&tc, cp) ;
- ! cast1_to_d(&tc) ;
- ! sp->type = C_DOUBLE ;
- ! sp->dval = tc.dval ;
- ! tc.dval -= 1.0 ;
- X field_assign(cp, &tc) ;
- X break ;
- ***************
- *** 715,721 ****
- X case F_PRE_INC :
- X cp = (CELL *) sp->ptr ;
- ! cast1_to_d(cellcpy(&tc, cp)) ;
- ! sp->dval = tc.dval += 1.0 ;
- ! sp->type = C_DOUBLE ;
- X field_assign(cp, sp) ;
- X break ;
- --- 775,780 ----
- X case F_PRE_INC :
- X cp = (CELL *) sp->ptr ;
- ! cast1_to_d(cellcpy(sp, cp)) ;
- ! sp->dval += 1.0 ;
- X field_assign(cp, sp) ;
- X break ;
- ***************
- *** 723,729 ****
- X case F_PRE_DEC :
- X cp = (CELL *) sp->ptr ;
- ! cast1_to_d(cellcpy(&tc, cp)) ;
- ! sp->dval = tc.dval -= 1.0 ;
- ! sp->type = C_DOUBLE ;
- X field_assign(cp, sp) ;
- X break ;
- --- 782,787 ----
- X case F_PRE_DEC :
- X cp = (CELL *) sp->ptr ;
- ! cast1_to_d(cellcpy(sp, cp)) ;
- ! sp->dval -= 1.0 ;
- X field_assign(cp, sp) ;
- X break ;
- ***************
- *** 1062,1066 ****
- X register CELL *cp ;
- X { int k ;
- - CELL *dp, *sp ;
- X
- X reswitch :
- --- 1120,1123 ----
- ***************
- *** 1075,1078 ****
- --- 1132,1137 ----
- X
- X case TWO_STRINGS :
- + case STRING_AND_STRNUM :
- + two_s:
- X k = strcmp(string(cp)->str, string(cp+1)->str) ;
- X free_STRING( string(cp) ) ;
- ***************
- *** 1080,1094 ****
- X return k ;
- X
- - case STRING_AND_STRNUM : /* posix numeric string bozosity */
- - case NOINIT_AND_STRING :
- - case DOUBLE_AND_STRING :
- - if ( cp->type == C_STRING ) { sp = cp ; dp = cp+1 ; }
- - else { dp = cp ; sp = cp+1 ; }
- -
- - check_strnum(sp) ;
- - if ( sp->type == C_STRING ) cast1_to_s(dp) ;
- - goto reswitch ;
- -
- -
- X case NOINIT_AND_DOUBLE :
- X case NOINIT_AND_STRNUM :
- --- 1139,1142 ----
- ***************
- *** 1097,1100 ****
- --- 1145,1151 ----
- X cast2_to_d(cp) ; goto two_d ;
- X
- + case NOINIT_AND_STRING :
- + case DOUBLE_AND_STRING :
- + cast2_to_s(cp) ; goto two_s ;
- X
- X case TWO_MBSTRNS :
- *** mawk/fcall.c Tue Mar 3 17:23:16 1992
- --- mawk112/fcall.c Tue Apr 7 12:56:14 1992
- ***************
- *** 12,19 ****
- X
- X
- ! /*$Log: fcall.c,v $
- ! * Revision 5.1 91/12/05 07:55:54 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 12,19 ----
- X
- X
- ! /*$Log: fcall.c,v $
- ! * Revision 5.1 1991/12/05 07:55:54 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/field.c Tue Mar 3 17:23:18 1992
- --- mawk112/field.c Mon Aug 17 07:17:22 1992
- ***************
- *** 11,18 ****
- X ********************************************/
- X
- ! /* $Log: field.c,v $
- ! * Revision 5.1 91/12/05 07:55:57 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 11,24 ----
- X ********************************************/
- X
- ! /* $Log: field.c,v $
- ! * Revision 5.3 1992/08/17 14:21:10 brennan
- ! * patch2: After parsing, only bi_sprintf() uses string_buff.
- ! *
- ! * Revision 5.2 1992/07/10 16:17:10 brennan
- ! * MsDOS: remove NO_BINMODE macro
- ! *
- ! * Revision 5.1 1991/12/05 07:55:57 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- ***************
- *** 313,321 ****
- X it could still damage us. Test it .
- X */
- ! string_buff[256] = 0 ;
- ! (void) sprintf(string_buff,
- ! string(fp)->str, 3.1459) ;
- ! if ( string_buff[256] )
- ! rt_error("CONVFMT assigned unusable value") ;
- X }
- X break ;
- --- 319,328 ----
- X it could still damage us. Test it .
- X */
- ! char xbuff[512] ;
- !
- ! xbuff[256] = 0 ;
- ! (void) sprintf( xbuff, string(fp)->str, 3.1459) ;
- ! if ( xbuff[256] )
- ! rt_error("CONVFMT assigned unusable value") ;
- X }
- X break ;
- ***************
- *** 406,417 ****
- X else /* its a double */
- X { int ival ;
- X
- X if ( (double)(ival = (int)cp->dval) == cp->dval )
- ! (void) sprintf(string_buff, "%d", ival) ;
- X else
- ! (void) sprintf(string_buff,
- ! string(CONVFMT)->str, cp->dval) ;
- X
- ! cp->ptr = (PTR) new_STRING(string_buff) ;
- X }
- X }
- --- 413,424 ----
- X else /* its a double */
- X { int ival ;
- + char xbuff[260] ;
- X
- X if ( (double)(ival = (int)cp->dval) == cp->dval )
- ! (void) sprintf(xbuff, "%d", ival) ;
- X else
- ! (void) sprintf(xbuff, string(CONVFMT)->str, cp->dval) ;
- X
- ! cp->ptr = (PTR) new_STRING(xbuff) ;
- X }
- X }
- ***************
- *** 570,574 ****
- X
- X
- ! #if MSDOS && NO_BINMODE==0
- X
- X int binmode() /* read current value of BINMODE */
- --- 577,581 ----
- X
- X
- ! #if MSDOS
- X
- X int binmode() /* read current value of BINMODE */
- *** mawk/field.h Tue Mar 3 17:23:18 1992
- --- mawk112/field.h Tue Apr 7 12:56:16 1992
- ***************
- *** 11,18 ****
- X ********************************************/
- X
- ! /* $Log: field.h,v $
- ! * Revision 5.2 92/01/06 08:10:24 brennan
- X * set_binmode() proto for MSDOS
- ! *
- X * Revision 5.1 91/12/05 07:59:16 brennan
- X * 1.1 pre-release
- --- 11,18 ----
- X ********************************************/
- X
- ! /* $Log: field.h,v $
- ! * Revision 5.2 1992/01/06 08:10:24 brennan
- X * set_binmode() proto for MSDOS
- ! *
- X * Revision 5.1 91/12/05 07:59:16 brennan
- X * 1.1 pre-release
- *** mawk/files.c Tue Mar 3 17:23:20 1992
- --- mawk112/files.c Fri Jul 10 09:07:45 1992
- ***************
- *** 2,6 ****
- X /********************************************
- X files.c
- ! copyright 1991, Michael D. Brennan
- X
- X This is a source file for mawk, an implementation of
- --- 2,6 ----
- X /********************************************
- X files.c
- ! copyright 1991, 1992. Michael D. Brennan
- X
- X This is a source file for mawk, an implementation of
- ***************
- *** 11,15 ****
- X ********************************************/
- X
- ! /*$Log: files.c,v $
- X * Revision 5.1 91/12/05 07:56:00 brennan
- X * 1.1 pre-release
- --- 11,29 ----
- X ********************************************/
- X
- ! /*$Log: files.c,v $
- ! * Revision 5.4 1992/07/10 16:10:30 brennan
- ! * patch2
- ! * MsDOS: remove useless NO_BINMODE macro
- ! * get process exit code on in pipes
- ! *
- ! * Revision 5.3 1992/04/07 20:21:17 brennan
- ! * patch 2
- ! * unbuffered output to a tty
- ! *
- ! * Revision 5.2 1992/04/07 16:03:08 brennan
- ! * patch 2
- ! * allow same filename for output and input, but use different descriptors
- ! * E.g. < "/dev/tty" and > "/dev/tty"
- ! *
- X * Revision 5.1 91/12/05 07:56:00 brennan
- X * 1.1 pre-release
- ***************
- *** 24,27 ****
- --- 38,45 ----
- X #include "fin.h"
- X
- + static FILE *PROTO(tfopen, (char*,char*)) ;
- + static void PROTO(add_to_child_list, (int,int)) ;
- + static struct child *PROTO(remove_from_child_list, (int)) ;
- + extern int PROTO(isatty, (int)) ;
- X
- X #ifdef V7
- ***************
- *** 47,52 ****
- X STRING *name ;
- X short type ;
- ! int pid ; /* we need to wait() when we close an out pipe */
- X /* holds temp file index under MSDOS */
- X PTR ptr ; /* FIN* or FILE* */
- X } FILE_NODE ;
- --- 65,75 ----
- X STRING *name ;
- X short type ;
- ! int pid ; /* we need to wait() when we close a pipe */
- X /* holds temp file index under MSDOS */
- +
- + #if HAVE_FAKE_PIPES
- + int inpipe_exit ;
- + #endif
- +
- X PTR ptr ; /* FIN* or FILE* */
- X } FILE_NODE ;
- ***************
- *** 63,66 ****
- --- 86,100 ----
- X }
- X
- + /* fopen() but no buffering to ttys */
- + static FILE *tfopen(name, mode)
- + char *name, *mode ;
- + {
- + FILE *retval = fopen(name,mode) ;
- +
- + if ( retval && isatty(fileno(retval)) ) setbuf(retval, (char*)0) ;
- + return retval ;
- + }
- +
- + /* find a file on file_list */
- X PTR file_find( sval, type )
- X STRING *sval ;
- ***************
- *** 75,83 ****
- X if ( !p ) /* open a new one */
- X {
- ! p = (FILE_NODE*) zmalloc(sizeof(FILE_NODE)) ;
- X switch( p->type = type )
- X {
- X case F_TRUNC :
- ! #if MSDOS && NO_BINMODE==0
- X ostr = (binmode()&2) ? "wb" : "w" ;
- X #else
- --- 109,117 ----
- X if ( !p ) /* open a new one */
- X {
- ! p = ZMALLOC(FILE_NODE) ;
- X switch( p->type = type )
- X {
- X case F_TRUNC :
- ! #if MSDOS
- X ostr = (binmode()&2) ? "wb" : "w" ;
- X #else
- ***************
- *** 84,88 ****
- X ostr = "w" ;
- X #endif
- ! if ( !(p->ptr = (PTR) fopen(name, ostr)) )
- X goto out_failure ;
- X break ;
- --- 118,122 ----
- X ostr = "w" ;
- X #endif
- ! if ( !(p->ptr = (PTR) tfopen(name, ostr)) )
- X goto out_failure ;
- X break ;
- ***************
- *** 89,93 ****
- X
- X case F_APPEND :
- ! #if MSDOS && NO_BINMODE==0
- X ostr = (binmode()&2) ? "ab" : "a" ;
- X #else
- --- 123,127 ----
- X
- X case F_APPEND :
- ! #if MSDOS
- X ostr = (binmode()&2) ? "ab" : "a" ;
- X #else
- ***************
- *** 94,98 ****
- X ostr = "a" ;
- X #endif
- ! if ( !(p->ptr = (PTR) fopen(name, ostr)) )
- X goto out_failure ;
- X break ;
- --- 128,132 ----
- X ostr = "a" ;
- X #endif
- ! if ( !(p->ptr = (PTR) tfopen(name, ostr)) )
- X goto out_failure ;
- X break ;
- ***************
- *** 130,137 ****
- X }
- X
- ! if ( strcmp(name, p->name->str) == 0 )
- ! { /* no distinction between F_APPEND and F_TRUNC here */
- ! if ( p->type != type &&
- ! (p->type < F_APPEND || type < F_APPEND)) goto type_failure ;
- X if ( !q ) /*at front of list */
- X return p->ptr ;
- --- 164,174 ----
- X }
- X
- ! /* search is by name and type */
- ! if ( strcmp(name, p->name->str) == 0 &&
- ! ( p->type == type ||
- ! /* no distinction between F_APPEND and F_TRUNC here */
- ! p->type >= F_APPEND && type >= F_APPEND ))
- !
- ! { /* found */
- X if ( !q ) /*at front of list */
- X return p->ptr ;
- ***************
- *** 138,145 ****
- X /* delete from list for move to front */
- X q->link = p->link ;
- ! break ;
- X }
- X q = p ; p = p->link ;
- ! }
- X
- X /* put p at the front of the list */
- --- 175,182 ----
- X /* delete from list for move to front */
- X q->link = p->link ;
- ! break ; /* while loop */
- X }
- X q = p ; p = p->link ;
- ! } /* end while loop */
- X
- X /* put p at the front of the list */
- ***************
- *** 151,161 ****
- X mawk_exit(1) ;
- X
- - type_failure :
- - rt_error("use of file \"%s\"\n\tis inconsistent with previous use",
- - name) ;
- X }
- X
- X
- ! /* close a file and delete it's node from the file_list */
- X
- X int file_close( sval )
- --- 188,198 ----
- X mawk_exit(1) ;
- X
- X }
- X
- X
- ! /* Close a file and delete it's node from the file_list.
- ! Walk the whole list, in case a name has two nodes,
- ! e.g. < "/dev/tty" and > "/dev/tty"
- ! */
- X
- X int file_close( sval )
- ***************
- *** 163,168 ****
- X { register FILE_NODE *p = file_list ;
- X FILE_NODE *q = (FILE_NODE *) 0 ; /* trails p */
- X char *name = sval->str ;
- ! int retval = 0 ;
- X
- X while ( p )
- --- 200,206 ----
- X { register FILE_NODE *p = file_list ;
- X FILE_NODE *q = (FILE_NODE *) 0 ; /* trails p */
- + FILE_NODE *hold ;
- X char *name = sval->str ;
- ! int retval = -1 ;
- X
- X while ( p )
- ***************
- *** 174,177 ****
- --- 212,216 ----
- X case F_APPEND :
- X (void) fclose((FILE *) p->ptr) ;
- + retval = 0 ;
- X break ;
- X
- ***************
- *** 189,192 ****
- --- 228,232 ----
- X case F_IN :
- X FINclose((FIN *) p->ptr) ;
- + retval = 0 ;
- X break ;
- X
- ***************
- *** 199,202 ****
- --- 239,243 ----
- X #if HAVE_FAKE_PIPES
- X (void) unlink(tmp_file_name(p->pid)) ;
- + retval = p->inpipe_exit ;
- X #endif
- X break ;
- ***************
- *** 204,217 ****
- X
- X free_STRING(p->name) ;
- ! if ( q ) q->link = p->link ;
- ! else file_list = p->link ;
- X
- ! zfree(p, sizeof(FILE_NODE)) ;
- ! return retval ;
- X }
- X else { q = p ; p = p->link ; }
- X
- ! /* its not on the list */
- ! return -1 ;
- X }
- X
- --- 245,257 ----
- X
- X free_STRING(p->name) ;
- ! hold = p ;
- ! if ( q ) q->link = p = p->link ;
- ! else file_list = p = p->link ;
- X
- ! ZFREE(hold) ;
- X }
- X else { q = p ; p = p->link ; }
- X
- ! return retval ;
- X }
- X
- *** mawk/files.h Tue Mar 3 17:23:20 1992
- --- mawk112/files.h Tue Apr 7 12:56:17 1992
- ***************
- *** 11,18 ****
- X ********************************************/
- X
- ! /*$Log: files.h,v $
- ! * Revision 5.1 91/12/05 07:59:18 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 11,18 ----
- X ********************************************/
- X
- ! /*$Log: files.h,v $
- ! * Revision 5.1 1991/12/05 07:59:18 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/fin.c Tue Mar 3 17:29:06 1992
- --- mawk112/fin.c Tue Aug 11 07:40:14 1992
- ***************
- *** 2,6 ****
- X /********************************************
- X fin.c
- ! copyright 1991, Michael D. Brennan
- X
- X This is a source file for mawk, an implementation of
- --- 2,6 ----
- X /********************************************
- X fin.c
- ! copyright 1991, 1992. Michael D. Brennan
- X
- X This is a source file for mawk, an implementation of
- ***************
- *** 11,19 ****
- X ********************************************/
- X
- ! /*$Log: fin.c,v $
- ! * Revision 5.2 92/02/21 13:30:08 brennan
- ! * fixed bug that free'd FILENAME twice if
- X * command line was var=value only
- ! *
- X * Revision 5.1 91/12/05 07:56:02 brennan
- X * 1.1 pre-release
- --- 11,29 ----
- X ********************************************/
- X
- ! /*$Log: fin.c,v $
- ! * Revision 5.5 1992/07/28 15:11:30 brennan
- ! * minor change in finding eol, needed for MsDOS
- ! *
- ! * Revision 5.4 1992/07/10 16:17:10 brennan
- ! * MsDOS: remove NO_BINMODE macro
- ! *
- ! * Revision 5.3 1992/07/08 16:14:27 brennan
- ! * FILENAME and FNR retain last values in the
- ! * END block.
- ! *
- ! * Revision 5.2 1992/02/21 13:30:08 brennan
- ! * fixed bug that free'd FILENAME twice if
- X * command line was var=value only
- ! *
- X * Revision 5.1 91/12/05 07:56:02 brennan
- X * 1.1 pre-release
- ***************
- *** 35,39 ****
- X #endif
- X
- ! /* This file handles input buffering */
- X
- X #ifndef MSDOS_MSC
- --- 45,52 ----
- X #endif
- X
- ! /* This file handles input files. Opening, closing,
- ! buffering and (most important) splitting files into
- ! records, FINgets().
- ! */
- X
- X #ifndef MSDOS_MSC
- ***************
- *** 77,81 ****
- X int oflag = O_RDONLY ;
- X
- ! #if MSDOS && NO_BINMODE==0
- X int bm = binmode() & 1 ;
- X if ( bm ) oflag |= O_BINARY ;
- --- 90,94 ----
- X int oflag = O_RDONLY ;
- X
- ! #if MSDOS
- X int bm = binmode() & 1 ;
- X if ( bm ) oflag |= O_BINARY ;
- ***************
- *** 84,88 ****
- X if ( filename[0] == '-' && filename[1] == 0 )
- X {
- ! #if MSDOS && NO_BINMODE==0
- X if ( bm ) setmode(0, O_BINARY) ;
- X #endif
- --- 97,101 ----
- X if ( filename[0] == '-' && filename[1] == 0 )
- X {
- ! #if MSDOS
- X if ( bm ) setmode(0, O_BINARY) ;
- X #endif
- ***************
- *** 160,165 ****
- X else /* return this line */
- X {
- ! if ( !(p = strchr(fin->buff, '\n')) )
- ! p = fin->buff + BUFFSZ + 1 ; /* unlikely to occur */
- X
- X *p = 0 ; *len_p = p - fin->buff ;
- --- 173,179 ----
- X else /* return this line */
- X {
- ! /* find eol */
- ! p = fin->buff ;
- ! while ( *p != '\n' && *p != 0 ) p++ ;
- X
- X *p = 0 ; *len_p = p - fin->buff ;
- ***************
- *** 340,343 ****
- --- 354,360 ----
- X FILENAME->type = C_STRING ;
- X FILENAME->ptr = (PTR) new_STRING( "-") ;
- + cell_destroy(FNR) ;
- + FNR->type = C_DOUBLE ;
- + FNR->dval = 0.0 ;
- X main_fin = FINdopen(0, 1) ;
- X }
- ***************
- *** 344,351 ****
- X
- X
- X void open_main()
- X { CELL argc ;
- X
- ! #if MSDOS && NO_BINMODE==0 /* set input modes */
- X int k = binmode() ;
- X
- --- 361,372 ----
- X
- X
- + /* this gets called once to get the input stream going.
- + It is called after the execution of the BEGIN block
- + unless there is a getline inside BEGIN {}
- + */
- X void open_main()
- X { CELL argc ;
- X
- ! #if MSDOS
- X int k = binmode() ;
- X
- ***************
- *** 361,364 ****
- --- 382,386 ----
- X }
- X
- + /* get the next command line file open */
- X static FIN *next_main(open_flag)
- X int open_flag ; /* called by open_main() if on */
- ***************
- *** 374,384 ****
- X
- X if ( main_fin ) FINclose(main_fin) ;
- ! cell_destroy( FILENAME ) ;
- ! FILENAME->type = C_NOINIT ;
- ! /* so don't free again if we go to set_main_to_stdin() */
- ! cell_destroy( FNR ) ;
- ! FNR->type = C_DOUBLE ;
- ! FNR->dval = 0.0 ;
- X
- X if ( cellcpy(&argc, ARGC)->type != C_DOUBLE )
- X cast1_to_d(&argc) ;
- --- 396,403 ----
- X
- X if ( main_fin ) FINclose(main_fin) ;
- ! /* FILENAME and FNR don't change unless we really open
- ! a new file */
- X
- + /* make a copy of ARGC to avoid side effect */
- X if ( cellcpy(&argc, ARGC)->type != C_DOUBLE )
- X cast1_to_d(&argc) ;
- ***************
- *** 397,400 ****
- --- 416,420 ----
- X if ( cp->type < C_STRING ) cast1_to_s(cp) ;
- X if ( string(cp)->len == 0 ) continue ;
- + /* file argument is "" */
- X
- X /* it might be a command line assignment */
- ***************
- *** 405,411 ****
- X if ( ! (main_fin = FINopen( string(cp)->str, 1 )) ) mawk_exit(1) ;
- X
- ! /* success */
- X (void) cellcpy(FILENAME , cp ) ;
- X free_STRING( string(cp) ) ;
- X return main_fin ;
- X }
- --- 425,436 ----
- X if ( ! (main_fin = FINopen( string(cp)->str, 1 )) ) mawk_exit(1) ;
- X
- ! /* success -- set FILENAME and FNR */
- ! cell_destroy(FILENAME) ;
- X (void) cellcpy(FILENAME , cp ) ;
- X free_STRING( string(cp) ) ;
- + cell_destroy(FNR) ;
- + FNR->type = C_DOUBLE ;
- + FNR->dval = 0.0 ;
- +
- X return main_fin ;
- X }
- ***************
- *** 417,423 ****
- X
- X /* real failure */
- - FILENAME->type = C_STRING ;
- - FILENAME->ptr = (PTR) new_STRING( "" ) ;
- -
- X { /* this is how we mark EOF on main_fin */
- X static char dead_buff = 0 ;
- --- 442,445 ----
- *** mawk/fin.h Tue Mar 3 17:23:22 1992
- --- mawk112/fin.h Tue Apr 7 12:56:19 1992
- ***************
- *** 11,18 ****
- X ********************************************/
- X
- ! /*$Log: fin.h,v $
- ! * Revision 5.2 92/01/06 08:16:24 brennan
- X * setmode() proto for MSDOS
- ! *
- X * Revision 5.1 91/12/05 07:59:20 brennan
- X * 1.1 pre-release
- --- 11,18 ----
- X ********************************************/
- X
- ! /*$Log: fin.h,v $
- ! * Revision 5.2 1992/01/06 08:16:24 brennan
- X * setmode() proto for MSDOS
- ! *
- X * Revision 5.1 91/12/05 07:59:20 brennan
- X * 1.1 pre-release
- *** mawk/hash.c Tue Mar 3 17:23:24 1992
- --- mawk112/hash.c Tue Apr 7 12:56:20 1992
- ***************
- *** 12,19 ****
- X
- X
- ! /* $Log: hash.c,v $
- ! * Revision 5.1 91/12/05 07:56:05 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 12,19 ----
- X
- X
- ! /* $Log: hash.c,v $
- ! * Revision 5.1 1991/12/05 07:56:05 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/init.c Tue Mar 3 17:23:24 1992
- --- mawk112/init.c Fri Jul 10 09:17:41 1992
- ***************
- *** 12,19 ****
- X
- X
- ! /* $Log: init.c,v $
- ! * Revision 5.2 92/01/09 08:46:14 brennan
- X * small change for MSC
- ! *
- X * Revision 5.1 91/12/05 07:56:07 brennan
- X * 1.1 pre-release
- --- 12,22 ----
- X
- X
- ! /* $Log: init.c,v $
- ! * Revision 5.3 1992/07/10 16:17:10 brennan
- ! * MsDOS: remove NO_BINMODE macro
- ! *
- ! * Revision 5.2 1992/01/09 08:46:14 brennan
- X * small change for MSC
- ! *
- X * Revision 5.1 91/12/05 07:56:07 brennan
- X * 1.1 pre-release
- ***************
- *** 65,69 ****
- X #endif
- X
- ! #if MSDOS && NO_BINMODE==0
- X { char *p = getenv("MAWKBINMODE") ;
- X
- --- 68,72 ----
- X #endif
- X
- ! #if MSDOS
- X { char *p = getenv("MAWKBINMODE") ;
- X
- ***************
- *** 167,171 ****
- X }
- X }
- ! #if MSDOS && NO_BINMODE==0
- X else
- X if ( optarg[0] == 'B' )
- --- 170,174 ----
- X }
- X }
- ! #if MSDOS
- X else
- X if ( optarg[0] == 'B' )
- *** mawk/init.h Tue Mar 3 17:23:26 1992
- --- mawk112/init.h Tue Apr 7 12:56:21 1992
- ***************
- *** 11,18 ****
- X ********************************************/
- X
- ! /* $Log: init.h,v $
- ! * Revision 5.1 91/12/05 07:59:22 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 11,18 ----
- X ********************************************/
- X
- ! /* $Log: init.h,v $
- ! * Revision 5.1 1991/12/05 07:59:22 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/jmp.c Tue Mar 3 17:23:26 1992
- --- mawk112/jmp.c Tue Apr 7 12:56:22 1992
- ***************
- *** 11,18 ****
- X ********************************************/
- X
- ! /* $Log: jmp.c,v $
- ! * Revision 5.1 91/12/05 07:56:10 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 11,18 ----
- X ********************************************/
- X
- ! /* $Log: jmp.c,v $
- ! * Revision 5.1 1991/12/05 07:56:10 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/jmp.h Tue Mar 3 17:23:28 1992
- --- mawk112/jmp.h Tue Apr 7 12:56:23 1992
- ***************
- *** 11,18 ****
- X ********************************************/
- X
- ! /* $Log: jmp.h,v $
- ! * Revision 5.1 91/12/05 07:59:24 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 11,18 ----
- X ********************************************/
- X
- ! /* $Log: jmp.h,v $
- ! * Revision 5.1 1991/12/05 07:59:24 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/kw.c Tue Mar 3 17:23:28 1992
- --- mawk112/kw.c Tue Apr 7 12:56:24 1992
- ***************
- *** 12,19 ****
- X
- X
- ! /* $Log: kw.c,v $
- ! * Revision 5.1 91/12/05 07:56:12 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 12,19 ----
- X
- X
- ! /* $Log: kw.c,v $
- ! * Revision 5.1 1991/12/05 07:56:12 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/main.c Tue Mar 3 17:23:28 1992
- --- mawk112/main.c Tue Apr 7 12:56:25 1992
- ***************
- *** 11,18 ****
- X ********************************************/
- X
- ! /* $Log: main.c,v $
- ! * Revision 5.1 91/12/05 07:56:14 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 11,18 ----
- X ********************************************/
- X
- ! /* $Log: main.c,v $
- ! * Revision 5.1 1991/12/05 07:56:14 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/makescan.c Tue Mar 3 17:23:30 1992
- --- mawk112/makescan.c Tue Apr 7 12:56:25 1992
- ***************
- *** 11,18 ****
- X ********************************************/
- X
- ! /*$Log: makescan.c,v $
- ! * Revision 5.1 91/12/05 07:56:16 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 11,18 ----
- X ********************************************/
- X
- ! /*$Log: makescan.c,v $
- ! * Revision 5.1 1991/12/05 07:56:16 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/matherr.c Tue Mar 3 17:23:30 1992
- --- mawk112/matherr.c Tue Apr 7 12:56:26 1992
- ***************
- *** 11,15 ****
- X ********************************************/
- X
- ! /*$Log: matherr.c,v $
- X * Revision 5.1 91/12/05 07:56:18 brennan
- X * 1.1 pre-release
- --- 11,20 ----
- X ********************************************/
- X
- ! /*$Log: matherr.c,v $
- ! * Revision 5.2 1992/03/31 16:14:44 brennan
- ! * patch2:
- ! * TURN_ON_FPE_TRAPS() macro
- ! * USE_IEEEFP_H macro
- ! *
- X * Revision 5.1 91/12/05 07:56:18 brennan
- X * 1.1 pre-release
- ***************
- *** 20,23 ****
- --- 25,32 ----
- X #include <math.h>
- X
- + #ifdef USE_IEEEFP_H
- + #include <ieeefp.h>
- + #endif
- +
- X #if FPE_TRAPS_ON
- X #include <signal.h>
- ***************
- *** 53,57 ****
- X
- X void fpe_init()
- ! { (void) signal(SIGFPE, fpe_catch) ; }
- X
- X #else /* FPE_TRAPS_ON==0 */
- --- 62,69 ----
- X
- X void fpe_init()
- ! {
- ! TURN_ON_FPE_TRAPS() ;
- ! (void) signal(SIGFPE, fpe_catch) ;
- ! }
- X
- X #else /* FPE_TRAPS_ON==0 */
- *** mawk/mawk.h Tue Mar 3 17:29:10 1992
- --- mawk112/mawk.h Mon Jul 6 13:12:32 1992
- ***************
- *** 2,6 ****
- X /********************************************
- X mawk.h
- ! copyright 1991, Michael D. Brennan
- X
- X This is a source file for mawk, an implementation of
- --- 2,6 ----
- X /********************************************
- X mawk.h
- ! copyright 1991 1992, Michael D. Brennan
- X
- X This is a source file for mawk, an implementation of
- ***************
- *** 12,19 ****
- X
- X
- ! /* $Log: mawk.h,v $
- ! * Revision 5.4 92/03/03 16:34:41 brennan
- X * conditional around open() proto
- ! *
- X * Revision 5.3 92/01/09 08:46:58 brennan
- X * cell destroy macro
- --- 12,22 ----
- X
- X
- ! /* $Log: mawk.h,v $
- ! * Revision 5.5 1992/07/06 20:15:49 brennan
- ! * DONT_PROTO_OPEN macro
- ! *
- ! * Revision 5.4 1992/03/03 16:34:41 brennan
- X * conditional around open() proto
- ! *
- X * Revision 5.3 92/01/09 08:46:58 brennan
- X * cell destroy macro
- ***************
- *** 157,164 ****
- X
- X /* ANSI compilers won't like open() if they've ever seen open as
- ! int open(char *,int, ...). If so remove it.
- X */
- X
- ! #ifndef _IBMR2 /* AIX */
- X int PROTO( open, (char *,int, int) ) ;
- X #endif
- --- 160,168 ----
- X
- X /* ANSI compilers won't like open() if they've ever seen open as
- ! int open(char *,int, ...). If so ,
- ! #define DONT_PROTO_OPEN
- X */
- X
- ! #ifndef DONT_PROTO_OPEN
- X int PROTO( open, (char *,int, int) ) ;
- X #endif
- *** mawk/memory.c Tue Mar 3 17:23:32 1992
- --- mawk112/memory.c Tue Apr 7 12:56:28 1992
- ***************
- *** 12,19 ****
- X
- X
- ! /* $Log: memory.c,v $
- ! * Revision 5.1 91/12/05 07:56:21 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 12,19 ----
- X
- X
- ! /* $Log: memory.c,v $
- ! * Revision 5.1 1991/12/05 07:56:21 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/memory.h Tue Mar 3 17:23:34 1992
- --- mawk112/memory.h Tue Apr 7 12:56:29 1992
- ***************
- *** 12,19 ****
- X
- X
- ! /* $Log: memory.h,v $
- ! * Revision 5.1 91/12/05 07:59:28 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 12,19 ----
- X
- X
- ! /* $Log: memory.h,v $
- ! * Revision 5.1 1991/12/05 07:59:28 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/modbison.awk Tue Mar 3 17:23:02 1992
- --- mawk112/modbison.awk Thu Jun 11 13:30:15 1992
- ***************
- *** 7,11 ****
- X # the most portable solution is to #if 0 it out
- X #
- ! # This script only works with bison 1.14
- X #
- X
- --- 7,11 ----
- X # the most portable solution is to #if 0 it out
- X #
- ! # This script works with bison 1.14 and 1.18
- X #
- X
- *** mawk/packing.list Tue Mar 3 17:28:52 1992
- --- mawk112/packing.list Wed Aug 26 21:05:58 1992
- ***************
- *** 1,5 ****
- X
- X ################################################
- ! # These files form the mawk distribution 1.1.1
- X #
- X # Mawk is an implementation of the AWK Programming Language as
- --- 1,5 ----
- X
- X ################################################
- ! # These files form the mawk distribution 1.1.2
- X #
- X # Mawk is an implementation of the AWK Programming Language as
- ***************
- *** 12,16 ****
- X README description of mawk 1.1
- X NEW changes from 1.0 to 1.1
- ! PATCHES changes from 1.1 to 1.1.1
- X INSTALL installation instructions
- X COPYING GNU General Public License, version 2
- --- 12,16 ----
- X README description of mawk 1.1
- X NEW changes from 1.0 to 1.1
- ! PATCHES changes from 1.1 to 1.1.2
- X INSTALL installation instructions
- X COPYING GNU General Public License, version 2
- ***************
- *** 103,106 ****
- --- 103,107 ----
- X config/sysV_ieeefp.h
- X config/sysV.h
- + config/sysVr4i386.h
- X config/msc_dos.h
- X config/think_c.h
- ***************
- *** 111,114 ****
- --- 112,117 ----
- X config/sgi.h
- X config/apollo.h
- + config/convex.h
- + config/aix.h
- X #######################
- X # directory: test testing and benchmarking directory
- *** mawk/parse.y Tue Mar 3 17:23:38 1992
- --- mawk112/parse.y Sat Aug 8 10:13:38 1992
- ***************
- *** 11,18 ****
- X ********************************************/
- X
- ! /* $Log: parse.y,v $
- ! * Revision 5.2 92/01/08 16:11:42 brennan
- X * code FE_PUSHA carefully for MSDOS large mode
- ! *
- X * Revision 5.1 91/12/05 07:50:22 brennan
- X * 1.1 pre-release
- --- 11,25 ----
- X ********************************************/
- X
- ! /* $Log: parse.y,v $
- ! * Revision 5.4 1992/08/08 17:17:20 brennan
- ! * patch 2: improved timing of error recovery in
- ! * bungled function definitions. Fixes a core dump
- ! *
- ! * Revision 5.3 1992/07/08 15:43:41 brennan
- ! * patch2: length returns. I am a wimp
- ! *
- ! * Revision 5.2 1992/01/08 16:11:42 brennan
- X * code FE_PUSHA carefully for MSDOS large mode
- ! *
- X * Revision 5.1 91/12/05 07:50:22 brennan
- X * 1.1 pre-release
- ***************
- *** 111,115 ****
- X %token <stp> ID D_ID
- X %token <fbp> FUNCT_ID
- ! %token <bip> BUILTIN
- X %token <cp> FIELD
- X
- --- 118,122 ----
- X %token <stp> ID D_ID
- X %token <fbp> FUNCT_ID
- ! %token <bip> BUILTIN LENGTH
- X %token <cp> FIELD
- X
- ***************
- *** 147,155 ****
- X program_block : PA_block /* pattern-action */
- X | function_def
- ! | error block
- ! { if (scope == SCOPE_FUNCT)
- ! { restore_ids() ; scope = SCOPE_MAIN ; }
- ! code_ptr = main_code_ptr ;
- ! }
- X ;
- X
- --- 154,158 ----
- X program_block : PA_block /* pattern-action */
- X | function_def
- ! | outside_error block
- X ;
- X
- ***************
- *** 417,420 ****
- --- 420,428 ----
- X code2(_BUILTIN , p->fp) ;
- X }
- + | LENGTH /* this is an irritation */
- + {
- + code1(_PUSHINT) ; code1(0) ;
- + code2(_BUILTIN, $1->fp) ;
- + }
- X ;
- X
- ***************
- *** 975,978 ****
- --- 983,1003 ----
- X }
- X ;
- +
- + outside_error : error
- + { /* we may have to recover from a bungled function
- + definition */
- +
- + /* can have local ids, before code scope
- + changes */
- + restore_ids() ;
- +
- + if (scope == SCOPE_FUNCT)
- + { scope = SCOPE_MAIN ;
- + active_funct = (FBLOCK*) 0 ;
- + }
- +
- + code_ptr = main_code_ptr ;
- + }
- + ;
- X
- X /* a call to a user defined function */
- *** mawk/parse2.xc Tue Mar 3 17:23:38 1992
- --- mawk112/parse2.xc Tue Apr 7 12:56:32 1992
- ***************
- *** 11,16 ****
- X ********************************************/
- X
- ! /* $Log: parse2.xc,v $
- ! Revision 5.1 91/12/05 07:52:38 brennan
- X 1.1 pre-release
- X
- --- 11,16 ----
- X ********************************************/
- X
- ! /* $Log: parse2.xc,v $
- ! Revision 5.1 1991/12/05 07:52:38 brennan
- X 1.1 pre-release
- X
- *** mawk/patchlev.h Tue Mar 3 17:29:14 1992
- --- mawk112/patchlev.h Wed Aug 26 20:06:41 1992
- ***************
- *** 1,3 ****
- X /* mawk 1.1 */
- ! #define PATCHLEVEL 1
- ! #define PATCH_STRING ".1"
- --- 1,3 ----
- X /* mawk 1.1 */
- ! #define PATCHLEVEL 2
- ! #define PATCH_STRING ".2"
- *** mawk/print.c Tue Mar 3 17:29:16 1992
- --- mawk112/print.c Mon Aug 17 07:19:34 1992
- ***************
- *** 11,19 ****
- X ********************************************/
- X
- ! /* $Log: print.c,v $
- ! * Revision 5.2 92/02/24 10:52:16 brennan
- X * printf and sprintf() can now have more args than % conversions
- X * removed HAVE_PRINTF_HD -- it was too obscure
- ! *
- X * Revision 5.1 91/12/05 07:56:22 brennan
- X * 1.1 pre-release
- --- 11,22 ----
- X ********************************************/
- X
- ! /* $Log: print.c,v $
- ! * Revision 5.3 1992/08/17 14:23:21 brennan
- ! * patch2: After parsing, only bi_sprintf() uses string_buff.
- ! *
- ! * Revision 5.2 1992/02/24 10:52:16 brennan
- X * printf and sprintf() can now have more args than % conversions
- X * removed HAVE_PRINTF_HD -- it was too obscure
- ! *
- X * Revision 5.1 91/12/05 07:56:22 brennan
- X * 1.1 pre-release
- ***************
- *** 38,41 ****
- --- 41,47 ----
- X char *sprintf_buff = string_buff ;
- X char *sprintf_limit = string_buff + SPRINTF_SZ ;
- +
- + /* Once execute() starts the sprintf code is (belatedly) the only
- + code allowed to use string_buff */
- X
- X static void print_cell(p, fp)
- *** mawk/re_cmpl.c Tue Mar 3 17:23:42 1992
- --- mawk112/re_cmpl.c Tue Apr 7 12:56:33 1992
- ***************
- *** 11,18 ****
- X ********************************************/
- X
- ! /* $Log: re_cmpl.c,v $
- ! * Revision 5.1 91/12/05 07:56:25 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 11,18 ----
- X ********************************************/
- X
- ! /* $Log: re_cmpl.c,v $
- ! * Revision 5.1 1991/12/05 07:56:25 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/regexp.h Tue Mar 3 17:23:42 1992
- --- mawk112/regexp.h Tue Apr 7 12:56:34 1992
- ***************
- *** 11,18 ****
- X ********************************************/
- X
- ! /*$Log: regexp.h,v $
- ! * Revision 5.1 91/12/05 07:59:30 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 11,18 ----
- X ********************************************/
- X
- ! /*$Log: regexp.h,v $
- ! * Revision 5.1 1991/12/05 07:59:30 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/repl.h Tue Mar 3 17:23:42 1992
- --- mawk112/repl.h Tue Apr 7 12:56:35 1992
- ***************
- *** 11,18 ****
- X ********************************************/
- X
- ! /*$Log: repl.h,v $
- ! * Revision 5.1 91/12/05 07:59:32 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 11,18 ----
- X ********************************************/
- X
- ! /*$Log: repl.h,v $
- ! * Revision 5.1 1991/12/05 07:59:32 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/scan.c Tue Mar 3 17:29:20 1992
- --- mawk112/scan.c Wed Jul 8 08:40:16 1992
- ***************
- *** 12,19 ****
- X
- X
- ! /* $Log: scan.c,v $
- ! * Revision 5.2 92/02/21 14:16:53 brennan
- X * fix: getline <=
- ! *
- X * Revision 5.1 91/12/05 07:56:27 brennan
- X * 1.1 pre-release
- --- 12,22 ----
- X
- X
- ! /* $Log: scan.c,v $
- ! * Revision 5.3 1992/07/08 15:43:41 brennan
- ! * patch2: length returns. I am a wimp
- ! *
- ! * Revision 5.2 1992/02/21 14:16:53 brennan
- X * fix: getline <=
- ! *
- X * Revision 5.1 91/12/05 07:56:27 brennan
- X * 1.1 pre-release
- ***************
- *** 555,558 ****
- --- 558,573 ----
- X current_token = BUILTIN ;
- X break ;
- +
- + case ST_LENGTH :
- +
- + yylval.bip = stp->stval.bip ;
- +
- + /* check for length alone, this is an ugly
- + hack */
- + while ( scan_code[ c = next() ] == SC_SPACE ) ;
- + un_next() ;
- +
- + current_token = c == '(' ? BUILTIN : LENGTH ;
- + break ;
- X
- X case ST_FIELD :
- *** mawk/scan.h Tue Mar 3 17:23:44 1992
- --- mawk112/scan.h Tue Apr 7 12:56:36 1992
- ***************
- *** 12,19 ****
- X
- X
- ! /* $Log: scan.h,v $
- ! * Revision 5.1 91/12/05 07:59:33 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- --- 12,19 ----
- X
- X
- ! /* $Log: scan.h,v $
- ! * Revision 5.1 1991/12/05 07:59:33 brennan
- X * 1.1 pre-release
- ! *
- X */
- X
- *** mawk/sizes.h Tue Mar 3 17:23:48 1992
- --- mawk112/sizes.h Wed Aug 26 20:20:29 1992
- ***************
- *** 2,6 ****
- X /********************************************
- SHAR_EOF
- true || echo 'restore of diffs2 failed'
- fi
- echo 'End of part 1'
- echo 'File diffs2 is continued in part 2'
- echo 2 > _shar_seq_.tmp
- exit 0
-
- exit 0 # Just in case...
-